<template>
  <el-collapse-item  v-if="enable" :name="name">
    <template #title>
        <span style="padding-left:20px">
          会签设置<el-icon class="header-icon"><info-filled /></el-icon>
        </span>
     </template>
        <MultiInstanceLoopCharacteristics
          :element="element"
          :loopCharacteristics = "loopCharacteristics"
          :bpmnModeler="bpmnModeler"
        />
  </el-collapse-item>
</template>
<script>
import MultiInstanceLoopCharacteristics from './parts/MultiInstanceLoopCharacteristics.vue'
import { getBusinessObject } from 'jeeplus-bpmn/lib/util/ModelUtil'
import { is } from 'jeeplus-bpmn/lib/util/ModelUtil'
export default {
  data () {
    return {
      loopCharacteristics: undefined
    }
  },
  components: {
    MultiInstanceLoopCharacteristics
  },
  computed: {
    enable () {
      if(this.element && is(this.element, 'bpmn:UserTask')) {
        var bo = getBusinessObject(this.element);
        this.loopCharacteristics = bo.loopCharacteristics;
        return true
        // return !!this.loopCharacteristics && is(this.loopCharacteristics, 'flowable:Collectable');
      } else {
        return false
      }
    //   if (this.element && is(this.element, 'bpmn:UserTask')) {
    //     var bo = getBusinessObject(this.element);
    //     this.loopCharacteristics = bo.loopCharacteristics;
    //     return true
    //   } else {
    //     return false
    //   }
    }
  },
  props: {
    element: {
      type: Object,
      default: undefined
    },
    bpmnModeler: {
      type: Object,
      default: undefined
    },
    name: ''
  }
}
</script>
